<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const banji = {
            name:'一班',
            status:['xiaoming',
                'xiaohua',
                'xiaohan'],
            //直接遍历对象 是不可以的,需要给对象设置Symbol.iterator属性
            [Symbol.iterator](){
                let index = 0;
                return {
                    next:()=>{
                        if(index < this.status.length){
                            const result =  {value:this.status[index],done:false}
                            index ++;
                            return result
                        }else{
                            return {value:undefined,done:true}
                        }
                        
                    }
                }
            }    
        }
        //用for...of 来遍历这个banji对象 如何做？？
        for(let v of banji){
            console.log(v)
        }
    </script>
</body>
</html>